<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@page import="avicit.platform6.core.locale.PlatformLocalesJSTL"%>
<%@page import="java.util.Locale"%>
<%@page import="avicit.platform6.api.session.SessionHelper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="avicit.platform6.commons.utils.ViewUtil"%>
<%@ taglib prefix="sec"
	uri="/WEB-INF/tags/shiro.tld"%>
<html>
<head>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>属性</title>
<base href="<%=ViewUtil.getRequestPath(request)%>">
<%@page import="avicit.platform6.api.sysshirolog.impl.AfterLoginSessionProcess"%>
<%
	Object lang = session
			.getAttribute(AfterLoginSessionProcess.SESSION_CURRENT_LANGUAGE_CODE);
	String languageCode = "zh_CN";
	if (lang != null) {
		languageCode = lang.toString();
	}
	Locale locale = SessionHelper.getLocaleByUser(request);
%>
<jsp:include
	page="/avicit/platform6/component/common/EasyUIJsInclude.jsp"></jsp:include>
<jsp:include page="/avicit/im/common/ImUIJSCSSInclude.jsp"></jsp:include>
<script type="text/javascript">
	var baseurl = '<%=request.getContextPath()%>';
	var dialogId = "${dialogId}"; // 当前对话框的ID
	var nodeId = "${lantopArchiveClass.id}";
	var nodeName = "${lantopArchiveClass.archiveClassNodeName}";
	var archiveType = "${lantopArchiveClass.archiveType}";
	var nodeType = "${nodeType}";
	$(function() {
		if(nodeType=="N"){
			document.getElementById("returnButton").style.display="none";
		}
		
		$("#archiveType").combobox("setValue", archiveType);
	});
	
	$.extend($.fn.validatebox.defaults.rules, {
		xy: {
	        validator: function(value,param){
	        	var jiedianName = $("#archiveClassNodeName").val();
	        	var regEn = /[`~!@$%^&*()+<>?:"{},.\;'[\]]/im,
	            regCn = /[·！￥：；“”‘，|《。》？\\\\【】[\]]/im;
	        	if(regEn.test(jiedianName) || regCn.test(jiedianName)) {
	        		return false;
	        	}else{
	        		return true;
	        	}   
	        },    
	        message: '名称不能含有特殊字符'  
	    }
	}); 
	
	function onClickCell(index, field, value){
		endEdtiorOnclick();
		if(field == "TABLE_TITLE"){
			$("#classGrid").datagrid('beginEdit',index);
		}else{
			$("#classGrid").datagrid('endEdit', index);
		}
	}
	
	function endEdtiorOnclick(){
		var rows = $("#classGrid").datagrid("getRows");
		for(var i=0;i<rows.length;i++){
			var row = rows[i];
			var rowIndex = $("#classGrid").datagrid("getRowIndex",row);
			$("#classGrid").datagrid('endEdit', rowIndex);
		}
	}

	$(window).resize(function(){
		setTimeout(function(){
			$("#mybox").layout('resize',{
				width:$(window).width(),
				height:$(window).height(),
			});
			$("#classGrid").datagrid('resize',{
				width:$(window).width(),
				height:$(window).height(),
			})
		},300)
	})
</script>
<script type="text/javascript"
	src="avicit/im/lantop/basic/libstructuredefine/LantopArchiveClassAttributeTable.js"></script>
<script type="text/javascript"
	src="avicit/im/lantop/basic/libstructuredefine/locale/language_<%=languageCode%>.js"></script>
<link href="static/css/custom/lantop/css/custom.css" type="text/css"  rel="stylesheet">
<style>
	
	.thead{
		text-align:right;
	}
	table input{
		width: 100%;
	    background: white;
	    border: 1px solid #dedede;
	    border-radius: 3px;
	    height: 23px !important;
	    line-height: 23px;
	    padding-left: 10px;
	    box-sizing:border-box;
	}
	
</style>
</head>
<body id="mybox" class="easyui-layout" fit="true">
	<div data-options="region:'north',border:false"
		style="height: 0; height: 190px;">
		<form id="formDetail" method="post">
			<table class="table_init"
				style="width: 700px;margin:0 auto;border-collapse: separate; border-spacing: 0px 10px;">
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_LantopArchiveClassAttributeTable_archiveClassNodeCode">
						<%-- 名称 --%>
						<td width="10%" class="thead"><span class="remind"
							style="color: red;">*</span><%=PlatformLocalesJSTL
						.getBundleValue(
								"lantop.basicdatamanager.libstructuredefine.structureDefine.table.button.archiveClassNodeName",
								"i18n.lantop", locale)%></td>
						<td width="40%"><input class="easyui-validatebox" type="text"
							value="${lantopArchiveClass.archiveClassNodeName}"
							style="width: 100%; height: 26px;" id="archiveClassNodeName"
							name="archiveClassNodeName" validType="xy[0,200]"
							data-options="required:true,validType:'length[1,100]'"></input></td>
					</sec:accesscontrollist>
				</tr>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_LantopArchiveClassAttributeTable_archiveClassNodeName">
						<%-- 标识 --%>
						<td width="10%" class="thead"><%=PlatformLocalesJSTL
						.getBundleValue(
								"lantop.basicdatamanager.libstructuredefine.structureDefine.table.button.archiveClassNodeCode",
								"i18n.lantop", locale)%></td>
						<td width="40%" class="input-readonly"><input
							class="easyui-validatebox disabled" type="text"
							value="${lantopArchiveClass.archiveClassNodeCode}"
							style="width: 100%; height: 26px;" id="archiveClassNodeCode"
							name="archiveClassNodeCode"
							data-options="required:true,validType:'length[1,100]'"
							disabled="disabled"></input></td>
					</sec:accesscontrollist>
				</tr>
				<tr>
					<sec:accesscontrollist hasPermission="3"
						domainObject="formdialog_LantopArchiveClassAttributeTable_archiveClassNodeName">
						<%-- 库表类型 --%>
						<td width="10%" class="thead"><%=PlatformLocalesJSTL
						.getBundleValue(
								"lantop.basicdatamanager.libstructuredefine.structureDefine.table.button.librayTableType",
								"i18n.lantop", locale)%></td>
						<td width="40%" class="input-readonly"><select
							style="width: 100%; height: 26px;" title="模板库" editable="false"
							data-options="panelHeight:'auto',editable:false,readonly:true,onShowPanel:comboboxOnShowPanel"
							class="easyui-combobox" name="archiveType" id="archiveType"
							disabled="disabled">
								<c:forEach items="${lanTopArchiveTypeList}"
									var="lanTopArchiveTypeList">
									<option value="${lanTopArchiveTypeList.lookupCode}">${lanTopArchiveTypeList.lookupName}</option>
								</c:forEach>
						</select></td>
					</sec:accesscontrollist>
				</tr>
				<input name="parentId" id="parentId" style="display: none;"
					value="${lantopArchiveClass.parentId}" />
				<input name="id" id="id" style="display: none;"
					value="${lantopArchiveClass.id}" />
			</table>
		</form>
	</div>
	<div data-options="region:'center',border:false" id="ppp">
		<table id="classGrid" class="easyui-datagrid"
			data-options="
				url:'platform/LantopArchiveClassController/loaddata?id='+nodeId,
				method: 'post',
				rownumbers: true,
				animate: true,
				collapsible: false,
				pagination:false,
				rownumbers:true,
				scrollbarSize:0,
				fit:false,
				height : 200,
				fitColumns: true,
				loadMsg:'数据加载中...',
				singleSelect: false,
				striped:false,
				autoRowHeight: false,
				onClickCell: onClickCell">
			<thead>
				<tr>

					<sec:accesscontrollist hasPermission="3"
						domainObject="LantopArchiveClass_LantopArchiveClassAttributeTable_table_tableCName">
						<%-- 库表中文名 --%>
						<th
							data-options="field:'TABLE_TITLE',align:'center',editor:'text'"
							width="50" title="库表中文名"><%=PlatformLocalesJSTL
						.getBundleValue(
								"lantop.basicdatamanager.libstructuredefine.structureDefine.table.button.librayTableCnName",
								"i18n.lantop", locale)%></th>
					</sec:accesscontrollist>
					<sec:accesscontrollist hasPermission="3"
						domainObject="LantopArchiveClass_LantopArchiveClassAttributeTable_table_tableTName">
						<%-- 库表真实表名 --%>
						<th data-options="field:'TABLE_NAME',align:'center'" width="50"
							title="库表真实表名"><%=PlatformLocalesJSTL
						.getBundleValue(
								"lantop.basicdatamanager.libstructuredefine.structureDefine.table.button.librayTableName",
								"i18n.lantop", locale)%></th>
					</sec:accesscontrollist>

				</tr>
			</thead>
		</table>
	</div>
	<div data-options="region:'south',border:false" style="height: 50px;">
		<!-- <div id="toolbar" class="datagrid-toolbar datagrid-toolbar-extend foot-formopera"> -->
		<table class="tableForm" border="0" cellspacing="1" width="100%">
			<tr>
				<sec:accesscontrollist hasPermission="3"
					domainObject="formdialog_LantopArchiveClassAttributeTable_button_Form">
					<td align="center">
						<%-- 保存 --%> <a style="margin: 5px;"
						title="<%=PlatformLocalesJSTL
						.getBundleValue(
								"lantop.basicdatamanager.libstructuredefine.structureDefine.table.button.save",
								"i18n.lantop", locale)%>"
						id="saveButton" class="easyui-linkbutton selbtn primary-btn"
						onclick="saveForm();" href="javascript:void(0);"> <img
							src="avicit/im/lantop/common/search/image/icon_tool10_blue.png" /><span
							class="selbtc"><%=PlatformLocalesJSTL
						.getBundleValue(
								"lantop.basicdatamanager.libstructuredefine.structureDefine.table.button.save",
								"i18n.lantop", locale)%></span></a>
						<%-- 重置 --%> <a style="margin: 5px;"
						title="<%=PlatformLocalesJSTL
						.getBundleValue(
								"lantop.basicdatamanager.libstructuredefine.structureDefine.table.button.reset",
								"i18n.lantop", locale)%>"
						id="resetButton" class="easyui-linkbutton selbtn"
						onclick="resetForm();" href="javascript:void(0);"> <img
							src="avicit/im/lantop/common/search/image/icon_tool039_blue.png" /><span
							class="selbtc"><%=PlatformLocalesJSTL
						.getBundleValue(
								"lantop.basicdatamanager.libstructuredefine.structureDefine.table.button.reset",
								"i18n.lantop", locale)%></span></a>
						<%-- 返回 --%> <a style="margin: 5px;"
						title="<%=PlatformLocalesJSTL
						.getBundleValue(
								"lantop.basicdatamanager.libstructuredefine.structureDefine.table.button.importStructureData.return",
								"i18n.lantop", locale)%>"
						id="returnButton" class="easyui-linkbutton selbtn"
						onclick="closeForm();" href="javascript:void(0);"> <img
							src="avicit/im/lantop/common/search/image/icon_tool42_blue.png" /><span
							class="selbtc"><%=PlatformLocalesJSTL
						.getBundleValue(
								"lantop.basicdatamanager.libstructuredefine.structureDefine.table.button.importStructureData.return",
								"i18n.lantop", locale)%></span></a>
					</td>
				</sec:accesscontrollist>
			</tr>
		</table>
	</div>
<script type="text/javascript" src="static/js/platform/index/js/divscroll.js"></script>
<script>
$(function(){
	$("#ppp").perfectScrollbar();
});
</script>
</body>
</html>
